import request from '@/utils/request'
export const login = (Vcode, telephone, password) => {
  return request.post(`/guests/verification/login/${Vcode}`, {
    telephone,
    password
  })
}

export const registry = (telephone, password, email, Vcode, idCard) => {
  return request.post(`/guests/verification/register/${Vcode}`, {
    telephone,
    password,
    email,
    idCard,
    nickname: 'user',
    imgUrl: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png'
  })
}

export const forgetPassword = (email, Vcode) => {
  return request.patch(`/guests/forger-password/verification/${email}/${Vcode}`)
}

export const updataPassword = (data) => {
  return request.patch('/guests/update-password', data)
}

export const getUserInfo = () => {
  return request.post('/guests/me')
}

export const updateUserInfo = (telephone, nickname, age, sex, idCard) => {
  return request.patch('/guests/update-info/', {
    telephone,
    nickname,
    age,
    sex,
    idCard
  })
}

// export const updataAvater = (file) => {
//   return request.post(`/guests/upload?file=${file}`)
// }
export const guestsForOrderStatusAll = () => {
  return request.get('/guests/manage/guestsForOrderStatusAll')
}

export const guestsForOrderStatus = () => {
  return request.get('/guests/manage/guestsForOrderStatus')
}

export const guestsForOrderStatusHistory = () => {
  return request.get('/guests/manage/guestsForOrderStatusHistory')
}

export const userVipVipId = (vipTypeId) => {
  return request.get('/user/vip/vipId', {
    params: {
      vipTypeId
    }
  })
}
